import re
import htmllib
import re
import htmllib
specialChars = ['"',
 "'",
 '\xc2\x99',
 '&',
 '<',
 '>',
 '\xc2\xa1',
 '\xc2\xa2',
 '\xc2\xa3',
 '\xc2\xa4',
 '\xc2\xa5',
 '\xc2\xa6',
 '\xc2\xa7',
 '\xc2\xa8',
 '\xc2\xa9',
 '\xc2\xaa',
 '\xc2\xab',
 '\xc2\xac',
 '\xc2\xae',
 '\xc2\xaf',
 '\xc2\xb0',
 '\xc2\xb1',
 '\xc2\xb2',
 '\xc2\xb3',
 '\xc2\xb4',
 '\xc2\xb5',
 '\xc2\xb6',
 '\xc2\xb7',
 '\xc2\xb8',
 '\xc2\xb9',
 '\xc2\xba',
 '\xc2\xbb',
 '\xc2\xbc',
 '\xc2\xbd',
 '\xc2\xbe',
 '\xc2\xbf',
 '\xc3\x97',
 '\xc3\xb7',
 '\xc3\x80',
 '\xc3\x81',
 '\xc3\x82',
 '\xc3\x83',
 '\xc3\x84',
 '\xc3\x85',
 '\xc3\x86',
 '\xc3\x87',
 '\xc3\x88',
 '\xc3\x89',
 '\xc3\x8a',
 '\xc3\x8b',
 '\xc3\x8c',
 '\xc3\x8d',
 '\xc3\x8e',
 '\xc3\x8f',
 '\xc3\x90',
 '\xc3\x91',
 '\xc3\x92',
 '\xc3\x93',
 '\xc3\x94',
 '\xc3\x95',
 '\xc3\x96',
 '\xc3\x98',
 '\xc3\x99',
 '\xc3\x9a',
 '\xc3\x9b',
 '\xc3\x9c',
 '\xc3\x9d',
 '\xc3\x9e',
 '\xc3\x9f',
 '\xc3\xa0',
 '\xc3\xa1',
 '\xc3\xa2',
 '\xc3\xa3',
 '\xc3\xa4',
 '\xc3\xa5',
 '\xc3\xa6',
 '\xc3\xa7',
 '\xc3\xa8',
 '\xc3\xa9',
 '\xc3\xaa',
 '\xc3\xab',
 '\xc3\xac',
 '\xc3\xad',
 '\xc3\xae',
 '\xc3\xaf',
 '\xc3\xb0',
 '\xc3\xb1',
 '\xc3\xb2',
 '\xc3\xb3',
 '\xc3\xb4',
 '\xc3\xb5',
 '\xc3\xb6',
 '\xc3\xb8',
 '\xc3\xb9',
 '\xc3\xba',
 '\xc3\xbb',
 '\xc3\xbc',
 '\xc3\xbd',
 '\xc3\xbe',
 '\xc3\xbf']

def unescape(s):
    p = htmllib.HTMLParser(None)
    p.save_bgn()
    p.feed(s)
    return p.save_end()



def removeAllSpecial(s):
    for x in specialChars:
        s = re.sub(x.decode('utf-8'), '', s)

    return s



def clearPunctuation(s):
    s = re.sub('[/\\:*?"<>|.!+()~@$%#^*,\\[\\]]', '', s)
    return s


if __name__ == '__main__':
    s = "null-\xc3\xa2\xc2\x99\xc2\xaaShe'sHappy-A\xc3\xbbuburn(lyrics)\xc3\xa2\xc2\x99\xc2\xab"
    print removeAllSpecial(s)

